package com.sptpc.mall.service;

import com.sptpc.mall.model.Category;
import com.sptpc.mall.repository.CategoryRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CategoryService {
    @Autowired
    private CategoryRepository categoryRepository;

    public Category saveCategory(String name){
        return categoryRepository.save(Category.builder().name(name).build());
    }
}
